home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_300 / 334_03 / unixplot.trm < prev    next >
Text File  |  1991-02-04  |  2KB  |  103 lines

  1. /* GNUPLOT -- unixplot.trm */
  2. /*
  3.  * Copyright (C) 1990   
  4.  *
  5.  * Permission to use, copy, and distribute this software and its
  6.  * documentation for any purpose with or without fee is hereby granted, 
  7.  * provided that the above copyright notice appear in all copies and 
  8.  * that both that copyright notice and this permission notice appear 
  9.  * in supporting documentation.
  10.  *
  11.  * Permission to modify the software is granted, but not the right to
  12.  * distribute the modified code.  Modifications are to be distributed 
  13.  * as patches to released version.
  14.  *  
  15.  * This software  is provided "as is" without express or implied warranty.
  16.  * 
  17.  * This file is included by ../term.c.
  18.  *
  19.  * This terminal driver supports:
  20.  *  Unix plot(5) graphics language
  21.  *
  22.  * AUTHORS
  23.  *  Colin Kelley, Thomas Williams, Russell Lang
  24.  * 
  25.  * send your comments or suggestions to (pixar!info-gnuplot@sun.com).
  26.  * 
  27.  */
  28.  
  29. /*
  30. Unixplot library writes to stdout.  A fix was put in place by
  31. ..!arizona!naucse!jdc to let set term and set output redirect
  32. stdout.  All other terminals write to outfile.
  33. */
  34.  
  35. #define UP_XMAX 4096
  36. #define UP_YMAX 4096
  37.  
  38. #define UP_XLAST (UP_XMAX - 1)
  39. #define UP_YLAST (UP_YMAX - 1)
  40.  
  41. #define UP_VCHAR (UP_YMAX/30)    /* just a guess--no way to know this! */
  42. #define UP_HCHAR (UP_XMAX/60)    /* just a guess--no way to know this! */
  43. #define UP_VTIC (UP_YMAX/80)
  44. #define UP_HTIC (UP_XMAX/80)
  45.  
  46. UP_init()
  47. {
  48.     openpl();
  49.     space(0, 0, UP_XMAX, UP_YMAX);
  50. }
  51.  
  52.  
  53. UP_graphics()
  54. {
  55.     erase();
  56. }
  57.  
  58.  
  59. UP_text()
  60. {
  61. }
  62.  
  63.  
  64. UP_linetype(linetype)
  65. int linetype;
  66. {
  67. static char *lt[2+5] = {"solid", "longdashed", "solid", "dotted","shortdashed",
  68.     "dotdashed", "longdashed"};
  69.  
  70.     if (linetype >= 5)
  71.         linetype %= 5;
  72.     linemod(lt[linetype+2]);
  73. }
  74.  
  75.  
  76. UP_move(x,y)
  77. unsigned int x,y;
  78. {
  79.     move(x,y);
  80. }
  81.  
  82.  
  83. UP_vector(x,y)
  84. unsigned int x,y;
  85. {
  86.     cont(x,y);
  87. }
  88.  
  89.  
  90. UP_put_text(x,y,str)
  91. unsigned int x,y;
  92. char str[];
  93. {
  94.     UP_move(x+UP_HCHAR/2,y+UP_VCHAR/5);
  95.     label(str);
  96. }
  97.  
  98. UP_reset()
  99. {
  100.     closepl();
  101. }
  102.  
  103.